package file;

import java.io.File;

/*
删除一个文件
*/
public class DelectFileDemo {
    public static void main(String[] args) {
        for (int i = 1; i <= 100; i++) {


            File file = new File("test"+i+".txt");

        if (file.exists()) {
            file.delete();
            System.out.println("该文件已删除！");
        }else {
            System.out.println("该文件不存在！");
        }
        }
    }
}
